package com.hancai.barrage.model;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.Collections;
import java.util.List;

/**
 * @author 涵菜
 * @version 1.0
 * <?>支持任意泛型类型
 * 网页类
 */
@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor
public class Page <T>{
    private Integer pageNum;
    private Integer pageSize;//每一页记录条数
    private Long total;//总记录条数
    private List<T> list;
    //返回一个空白页
    public static<T>  Page<T> empty(Integer pageNum,Integer pageSize){
        return new Page<>(pageNum,pageSize,0l, Collections.emptyList());
    }
}
